<?php


?>
<html>
<head>
<link rel="stylesheet" href="mycss3.css" type="text/css" />
<script type="javascript" src="jquery-1.7.1.js"></script>
<script type="javascript">
$(function(){
	$("#bt_reg1").click(function(){
		$("").hide();
		$(".receive_reg").show();
	
	});


});
</script>
<meta charset="utf-8">
</head>
<body>
<div id="Header">
	<ul id="a">
		<li><a href="index.php">首页</a></li>
		<li><a href="#">发现</a></li>
		<li style="float:right;padding:0 3px;"><a href="reg.php">注册</a></li>
		<li id="b" style="float:right;padding:0 3px;"><a id="login1" href="index.php">登录</a></li>
	</ul>
</div>

<div class="Content" style="background:#E7E7E7;">

<form class="reg_form" method="post" action="reg_process.php">
<td>用户名<input type="text" name="reg_name" id="reg_name" class="reg_" /></td>
<td>密码<input type="password" name="reg_pass" id="reg_pass" class="reg_" /></td>
<td>确认密码<input type="password" name="reg_pass2" id="reg_pass2" class="reg_" /></td>
<td>邮箱<input type="text" name="email" id="email" class="reg_" /></td>
<input type="hidden" name="hidd" value="hidd" />
<input type="submit" name="bt_reg1" value="注册" id="bt_reg1" style="float:left" />
<input type="reset" name="bt_cancel" value="重置" id="bt_cancel" style="float:left" />
</form>

</div>

<div class="receive_reg" style="display:block;">
<tr>
	<td>
		<?php
		include_once("conn.php");
		$regname = $_POST["reg_name"];
		$regpass = $_POST["reg_pass"];
		$regpass2 = $_POST["reg_pass2"];
		$email = $_POST["email"];
		if( $regpass == $regpass2 && $regname != NULL && $regpass != NULL && $email != NULL )
		{
			$sql="insert into tb_user_info(name,password,email) values('".$regname."','".$regpass."','".$email."')";
			$result=mysql_query($sql);
			echo "注册成功！";
			echo "<br>";
			echo "<a href='#'>一封激活邮件已经发往您的邮箱！请激活邮件后登录！</a>";
		}
		else if( $_POST["hidd"]!=NULL &&( $regname == NULL || $regpass == NULL || $regpass2 == NULL || $email == NULL ))
		{
			echo "<script>alert('请不要放空项');</script>";

		}
		else if( $regpass != $regpass2 )
		{
			echo "<script>alert('输入2次密码不一致');</script>";
		}
		?>
	</td>
</tr>

</div>

</body>
</html>